package com.powersystem.demo.service.impl;

import com.powersystem.demo.entity.PsUser;
import com.powersystem.demo.mapper.PsUserMapper;
import com.powersystem.demo.service.IPsUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author linrongji
 * @since 2019-11-14
 */
@Service
public class PsUserServiceImpl extends ServiceImpl<PsUserMapper, PsUser> implements IPsUserService {

    @Autowired
    private PsUserMapper psUserMapper;

    @Override
    public int fetchUserRole(String openId) {
        return psUserMapper.fetchUserRole(openId);
    }

    @Override
    public List<PsUser> selectByRoleId(int roleId) {
        return psUserMapper.selectByRoleId(roleId);
    }

    @Override
    public List<PsUser> selectByuserNameAndUserStatus(String username, int userstatus) {
        return psUserMapper.selectByuserNameAndUserStatus(username,userstatus);
    }
}
